<template>
    <div class="err">
        <h1>404</h1>
        <h2>不存在的页面</h2>
        <p>网页出错,或你访问的网页不存在.<router-link to="/">返回首页</router-link>
        </p>
        <p>页面将在<a>{{ time }}s</a>后跳转首页</p>
    </div>
</template>

<script>
export default {
    data() {
        return {
            time: 5
        }
    },
    mounted() {
        const clearTime = setInterval(() => {
            if (this.time > 0) {
                this.time--;
            } else {
                clearInterval(clearTime)
                this.$router.push('/')
            }
        }, 1000);
    }
}
</script>
<style lang='scss' scoped>
.err {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: rgb(80, 189, 220);
    justify-content: center;
    align-items: center;

    h1 {

        font-size: 100px;
        color: white;
        margin-bottom: .625rem;
    }

    h2 {

        font-size: 50px;
        color: white;
        margin-bottom: 1.25rem;
    }

    p {

        font-size: 20px;
        color: white;
        margin-bottom: 1.25rem;

        a {

            text-decoration: underline;
            color: red;
        }
    }
}
</style>
